﻿using Assets.Script.HelpSystem.AtkSystem.Base;
using Assets.Script.Human.Player;
using Assets.Script.Tools;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

namespace Assets.Script.HelpSystem.AtkSystem.AtkWays
{
    public class AtkWayShootNormal : AtkWay
    {
        AudioSource audioSource;

        public AtkWayShootNormal(PlayerBody playerBody, AtkInfo atkInfo, Dictionary<Type, int> bulletEffectLevel, int index) : base(playerBody, atkInfo, bulletEffectLevel, index)
        {
            audioSource = playerBody.gameObject.AddComponent<AudioSource>();
            audioSource.playOnAwake = false;
            audioSource.clip = Resources.Load<AudioClip>(ResourcePath.Audio.Man_Atk);
        }

        protected override void SetData(params object[] o)
        {
            base.SetData(o);
            atkWaitTime = 0;
            coolTime = 1f / playerBody.PlayerData.AtkSpeed;
            attackDir = playerBody.PlayerData.AttackDir;
            
        }

        protected override void UpdateInAttack()
        {
            Attack_Invoke();
        }

    }
}
